(in-package :lilu-mcclim-apropos)

;;;
;;; print
;;;

(defparameter *apropos-heading-text-style* (clim:make-text-style
                                                      nil
                                                      :bold 15))

(defparameter *apropos-sub-heading-text-style* (clim:make-text-style
                                                          nil
                                                          :bold 11))


(defun %print-heading-text (text pane)
  (fresh-line pane)
  (clim:stream-increment-cursor-position pane 10 5)
  (clim:surrounding-output-with-border
   (pane :shape :underline :ink clim:+black+)
   (clim:with-text-style (pane *apropos-heading-text-style*)
     (princ text pane))))

(defun %print-sub-heading-text (text pane)
  (fresh-line pane)
  (clim:stream-increment-cursor-position pane 10 5)
  (clim:surrounding-output-with-border
   (pane :shape :underline :ink clim:+black+)
   (clim:with-text-style (pane *apropos-sub-heading-text-style*)
     (princ text pane))))

(defun %print-error (condition pane)
  (fresh-line pane)
  (clim:stream-increment-cursor-position pane 10 5)
  (clim:with-drawing-options (pane :ink clim:+red+)
    (%print-heading-text "Syntax Error" pane)
    (fresh-line pane)
    (clim:stream-increment-cursor-position pane 10 0)
    (princ condition pane)))

(defun %print-text (pane text &optional (x-offset 0))
  (fresh-line pane)
  (clim:stream-increment-cursor-position pane (+ x-offset 10) 0)
  (princ text pane))

(defun %print-property (pane name val &optional (x-offset 0) (missing-p nil))
  (fresh-line pane)
  (clim:stream-increment-cursor-position pane (+ x-offset 10) 0)
  (format pane "~A: " name)
  (clim:with-drawing-options (pane :ink
                                   (if (and val (not missing-p))
                                       clim:+blue+
                                       clim:+gray+))
    (if (consp val)
        (format pane " ~{~A~^, ~}" val)
        (format pane "~A" val))))

;;;
;;; util
;;;

;;;
;;; presentation
;;;


;;;
;;;
;;;
